import request from '@/utils/request';
const api_name = '/news';

export default {
  // 通过id获取新闻
  getNewsById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'get'
    });
  },
  // 查询所有新闻
  getAllNews() {
    return request({
      url: `${api_name}/`,
      method: 'get'
    });
  }
};
